@import '/variable.less';

.my-container {
  min-height: 100vh;
  background: #FAF8F3;
  padding-bottom: 100px;
}

/* 顶部个人信息区 */
.profile-section {
  .profile-background {
    background: linear-gradient(135deg, #EDE7F6, #BBDEFB);
    padding: 40px 20px 30px;
    position: relative;
    overflow: hidden;

    &::before {
      content: '';
      position: absolute;
      top: -50%;
      right: -20%;
      width: 200px;
      height: 200px;
      background: rgba(255, 255, 255, 0.1);
      border-radius: 50%;
    }

    &::after {
      content: '';
      position: absolute;
      bottom: -30%;
      left: -10%;
      width: 150px;
      height: 150px;
      background: rgba(255, 255, 255, 0.1);
      border-radius: 50%;
    }
  }

  .profile-content {
    position: relative;
    z-index: 1;
    text-align: center;

    .avatar-section {
      position: relative;
      display: inline-block;
      margin-bottom: 20px;

      .avatar {
        width: 100px;
        height: 100px;
        border-radius: 50%;
        border: 4px solid rgba(255, 255, 255, 0.8);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
      }

      .avatar-edit {
        position: absolute;
        bottom: 0;
        right: 0;
        width: 32px;
        height: 32px;
        background: #FFB347;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 8px rgba(255, 179, 71, 0.3);
      }
    }

    .user-info {
      margin-bottom: 24px;

      .user-name {
        font-size: 24px;
        font-weight: bold;
        color: #333333;
        margin-bottom: 8px;
      }

      .user-title {
        display: inline-block;
      }
    }

    .user-stats {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 32px;

      .stat-item {
        text-align: center;
        transition: all 0.3s ease;

        &:active {
          transform: scale(0.95);
        }

        .stat-number {
          font-size: 20px;
          font-weight: bold;
          color: #333333;
          margin-bottom: 4px;
        }

        .stat-label {
          font-size: 14px;
          color: #666666;
        }
      }

      .stat-divider {
        width: 1px;
        height: 30px;
        background: rgba(255, 255, 255, 0.3);
      }
    }
  }
}

/* 通用标题样式 */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;

  .section-title {
    font-size: 18px;
    font-weight: 600;
    color: #333333;
  }

  .section-count,
  .section-more {
    font-size: 14px;
    color: #FFB347;
    font-weight: 500;
  }
}

/* 徽章墙 */
.badges-section {
  margin: 20px;
  padding: 20px;
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);

  .badges-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;

    .badge-item {
      text-align: center;
      transition: all 0.3s ease;

      &:active {
        transform: scale(0.95);
      }

      .badge-icon {
        width: 60px;
        height: 60px;
        border-radius: 12px;
        margin: 0 auto 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;

        &.literature {
          background: linear-gradient(135deg, #FFE0B2, #FFCC02);
        }

        &.scifi {
          background: linear-gradient(135deg, #E3F2FD, #2196F3);
        }

        &.history {
          background: linear-gradient(135deg, #F3E5F5, #9C27B0);
        }

        &.philosophy {
          background: linear-gradient(135deg, #E8F5E8, #4CAF50);
        }

        &.poetry {
          background: linear-gradient(135deg, #FFF3E0, #FF9800);
        }

        image {
          width: 40px;
          height: 40px;
        }
      }

      .badge-name {
        font-size: 12px;
        color: #666666;
        line-height: 1.3;
      }
    }
  }
}

/* 我的书单 */
.booklist-section {
  margin: 0 20px 20px;

  .booklist-scroll {
    white-space: nowrap;
  }

  .booklist-container {
    display: inline-flex;
    gap: 16px;
    padding-right: 20px;
  }

  .book-item {
    text-align: center;
    min-width: 80px;
    transition: all 0.3s ease;

    &:active {
      transform: scale(0.95);
    }

    .book-cover {
      width: 80px;
      height: 120px;
      border-radius: 8px;
      margin-bottom: 8px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .book-title {
      font-size: 12px;
      color: #333333;
      white-space: normal;
      line-height: 1.3;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    }
  }
}

/* 我的互动记录 */
.interactions-section {
  margin: 0 20px 20px;
  padding: 20px;
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);

  .interaction-tabs {
    display: flex;
    background: #F5F5F5;
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;

    .tab-item {
      flex: 1;
      text-align: center;
      padding: 12px;
      font-size: 14px;
      color: #888888;
      transition: all 0.3s ease;

      &.active {
        background: #FFB347;
        color: #FFFFFF;
        font-weight: 600;
      }

      &:active {
        background: #FFA726;
      }
    }
  }

  .interaction-list {
    .interaction-item {
      display: flex;
      align-items: center;
      padding: 16px 0;
      border-bottom: 1px solid #F0F0F0;
      transition: all 0.3s ease;

      &:last-child {
        border-bottom: none;
      }

      &:active {
        background: #FAFAFA;
        border-radius: 8px;
        margin: 0 -8px;
        padding: 16px 8px;
      }

      .interaction-avatar {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        margin-right: 16px;
        overflow: hidden;

        image {
          width: 100%;
          height: 100%;
        }
      }

      .interaction-content {
        flex: 1;

        .interaction-title {
          font-size: 16px;
          font-weight: 600;
          color: #333333;
          margin-bottom: 4px;
        }

        .interaction-desc {
          font-size: 14px;
          color: #666666;
          margin-bottom: 4px;
        }

        .interaction-time {
          font-size: 12px;
          color: #888888;
        }
      }

      .interaction-action {
        margin-left: 16px;
      }
    }
  }
}

/* 设置区 */
.settings-section {
  margin: 0 20px;

  .settings-list {
    background: #FFFFFF;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);

    .setting-item {
      display: flex;
      align-items: center;
      padding: 20px;
      border-bottom: 1px solid #F0F0F0;
      transition: all 0.3s ease;

      &:last-child {
        border-bottom: none;
      }

      &:active {
        background: #FAFAFA;
      }

      &.logout {
        .setting-title {
          color: #FF6B6B;
        }
      }

      .setting-icon {
        width: 40px;
        height: 40px;
        border-radius: 8px;
        background: #F5F5F5;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 16px;
      }

      .setting-content {
        flex: 1;

        .setting-title {
          font-size: 16px;
          font-weight: 600;
          color: #333333;
          margin-bottom: 4px;
        }

        .setting-desc {
          font-size: 14px;
          color: #888888;
        }
      }

      .setting-arrow {
        margin-left: 16px;
      }
    }
  }
}
